package com.zb.feigns.fallback;

import com.zb.feigns.WemediaFeign;
import com.zb.model.common.Result;
import com.zb.model.pojo.wemedia.WmUser;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class WemediaFeignFallback implements FallbackFactory<WemediaFeign> {
    @Override
    public WemediaFeign create(Throwable throwable) {
        return new WemediaFeign() {
            @Override
            public Result<Integer> save(WmUser wmUser) {
                return Result.ERROR();
            }
            @Override
            public Result<WmUser> findByName(String name) {
                return Result.ERROR();
            }
        };
    }
}
